package com.koi.pojo.system;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * @author ･ᴗ･
 * @description [通知公告表模型]
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("sys_notice")
public class SysNotice implements Serializable {

    /**
     * 公告ID
     */
    @TableId(value = "notice_id", type = IdType.ASSIGN_ID)
    private Long noticeId;

    /**
     * 公告标题
     */
    @NotBlank(message = "公告标题不能为空")
    @TableField(value = "notice_title")
    private String noticeTitle;

    /**
     * 公告类型[1-通知 2-公告]
     */
    @NotBlank(message = "公告类型不能为空")
    @TableField(value = "notice_type")
    private String noticeType;

    /**
     * 公告内容
     */
    @TableField(value = "notice_content")
    private String noticeContent;

    /**
     * 公告状态[0-正常 1-关闭]
     */
    @NotBlank(message = "公告状态不能为空")
    @TableField(value = "notice_status")
    private String noticeStatus;

    /**
     * 显示顺序
     */
    @NotNull(message = "显示顺序不能为空")
    @TableField(value = "sorted")
    private Integer sorted;

    /**
     * 创建者
     */
    @TableField(value = "create_by")
    private String createBy;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    /**
     * 更新者
     */
    @TableField(value = "update_by")
    private String updateBy;

    /**
     * 更新时间
     */
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

    /**
     * 备注
     */
    @TableField(value = "remark")
    private String remark;

}
